const mongoose = require('mongoose')
const Scheme = mongoose.Schema
mongoose.connect('mongodb://localhost/code_order')

const moment = require('moment')

const rechargeSchema = new Scheme({
  oddId: {  //单号
    type: Number,
    required: true
  },
  userId: {  //用户id
    type: String,
    required: true
  },
  nickName: {  //用户昵称
    type: String,
    required: true
  },
  money: {  //充值金额
    type: Number,
    required: true
  },
  status: {  //状态  0未审核  1已审核
    type: Number,
    default: 0
  },
  createTime: {  //创建时间
    type: String,
    default: moment().format("YYYY-MM-DD HH:mm:ss")
  }
})

const Recharge = mongoose.model('recharge', rechargeSchema)
module.exports = Recharge
